<div id="content" class="clearfix">
  <h3><?php echo $this->title;?></h3>
<?php $form=$this->beginWidget('ActiveForm', array(
	'id'=>'login-form',
	'method'=>'get',
	'action'=>$this->createUrl('manager/user'),
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>false,
	),
)); ?>
    <div class="section">
      <h4 class="heading_bg">查询条件</h4>
      <!--      <h5>合约销售查询</h5>-->
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="normal">
        <tr>
          <th class="tleft"><?php echo $form->label($model,'eparchy_code'); ?></th>
          <td id="select">            
            <?php echo $form->dropDownList($model,'eparchy_code',Eparchy::model()->getListData(),array('prompt'=>'---------','onchange'=>'departEparchyChange(\''.$form->getClientId($model,'eparchy_code').'\',\''.$form->getClientId($model,'depart_code').'\',true)',)); ?>
            <?php echo $form->error($model,'eparchy_code'); ?>
          </td>
          <th class="tleft"><?php echo $form->label($model,'depart_code'); ?></th>
          <td id="select">
            <?php echo $form->dropDownList($model,'depart_code',Depart::model()->getListDataByEparchy($model->eparchy_code),array('prompt'=>'---------',)); ?>
            <?php echo $form->error($model,'product_id'); ?>
          </td>
        </tr>
        <tr>
          <th class="tleft"><?php echo $form->label($model,'user_name'); ?></th>
          <td>
            <?php echo $form->textField($model,'user_name',array('size'=>30,)); ?>
            <?php echo $form->error($model,'user_name'); ?>
          </td>
          <th class="tleft"><?php echo $form->label($model,'phone'); ?></th>
          <td>
            <?php echo $form->textField($model,'phone',array('size'=>30,)); ?>
            <?php echo $form->error($model,'phone'); ?>
          </td>
        </tr>
      </table>
      <p class="inquiry">
      	<?php echo CHtml::submitButton('查询',array('class'=>'btn',))?>
      	<?php echo CHtml::resetButton('重置',array('class'=>'btn'))?>
      </p>
      <!--div.section -->
    </div>
    <div class="section">
      <h4 class="heading_bg">查询结果</h4>
      	<?php $this->widget('zii.widgets.grid.CGridView', array(
			'dataProvider'=>$dataProvider,
			//'filter'=>$model,
			'summaryCssClass' => 'summary1',
			'pagerCssClass'=>'pager1',
			'pager'=>array(
				'header'=>'',
				),
			'columns'=>array(
				array(
					'name'=>'staff_id',
                    'value'=>'$data->staff_id',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'user_name',
                    'value'=>'$data->user_name',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
                    //'header'=>'日期'
				),
				array(
					'name'=>'phone',
                    'value'=>'$data->phone',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
                    //'header'=>'日期'
				),
				array(
					'name'=>'eparchy_code',
                    'value'=>'$data->eparchy_code',
                    //'header'=>'发起人',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'depart_code',
                    'value'=>'$data->departCode->depart_name',
                    //'header'=>'发起人',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'state_code',
                    'value'=>'$data->stateCode->state_name',
                    //'header'=>'发起人',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),
				array(
					'name'=>'post_code',
                    'value'=>'$data->postCode->post_name',
                    //'header'=>'发起人',
                    'htmlOptions'=>array('nowrap'=>'nowrap'),
                    'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
				),

				array(
					'class'=>'CButtonColumn',
					'htmlOptions'=>array('nowrap'=>'nowrap'),
					'headerHtmlOptions'=>array('nowrap'=>'nowrap'),
					'header'=>'操作',
					'template'=>'{delete}  {update}',
					//'deleteButtonLabel'=>'删除',
					//'updateButtonLabel'=>'修改',
					//'deleteButtonImageUrl'=>false,
					//'updateButtonImageUrl'=>false,
					'deleteButtonUrl'=>'"userdelete/id/".$data->id',
					'updateButtonUrl'=>'"userupdate/id/".$data->id',
					'deleteConfirmation'=>'确认将该用户变为离职吗?',
				),
			), 
		)); ?>
	  <p class="inquiry">
      	<?php echo CHtml::Button('新增用户',array('class'=>'btn','onClick'=>'window.location.href=\''.$this->createUrl('manager/usernew').'\''))?>
      </p>
      <!-- <div class="content-link"><a href="#wrapper">▲回到顶部</a></div> -->
    </div>
<?php $this->endWidget(); ?>
  <!-- div#content end -->
</div>
